package com.yystudy.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yystudy.common.result.Result;
import com.yystudy.model.system.SysOperLog;
import com.yystudy.model.vo.SysOperLogQueryVo;
import com.yystudy.system.service.OperLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "操作日志管理接口")
@RestController
@RequestMapping("/admin/system/sysOperLog")
public class SysOperLogController {

    @Autowired
    private OperLogService operLogService;


    /**
     * 分页条件查询
     * @param page
     * @param limie
     * @param sysOperLogQueryVo
     * @return
     */
    @ApiOperation(value = "分页条件查询")
    @GetMapping("/{page}/{limie}")
    @PreAuthorize("hasAuthority('bnt.sysOperLog.list')")
    public Result logIndex(@PathVariable Long page,
                           @PathVariable Long limie,
                           SysOperLogQueryVo sysOperLogQueryVo){
        IPage<SysOperLog> pageModel = operLogService.selectPage(page,limie,sysOperLogQueryVo);
        return Result.ok(pageModel);
    }
}
